//===============================================================================
// Microsoft patterns & practices Enterprise Library Contribution
// Validation Application Block
//===============================================================================

using EntLibContrib.Validation.Configuration.Design.Properties;

namespace EntLibContrib.Validation.Configuration.Design.Nodes
{
	/// <summary>
	/// Externally Configured Object Collection Validator Node
	/// </summary>
	public class ExternallyConfiguredObjectCollectionValidatorNode : ExternallyConfiguredObjectValidatorNode
	{
		#region Construction
		/// <summary>
		/// Initializes a new instance of the <see cref="ExternallyConfiguredObjectCollectionValidatorNode"/> class.
		/// </summary>
		public ExternallyConfiguredObjectCollectionValidatorNode()
			: this(new ExternallyConfiguredObjectCollectionValidatorData(Resources.ExternallyConfiguredObjectCollectionValidatorNodeName))
		{
		}

		/// <summary>
		/// Initializes a new instance of the <see cref="ExternallyConfiguredObjectCollectionValidatorNode"/> class.
		/// </summary>
		/// <param name="validatorData">The validator data.</param>
		public ExternallyConfiguredObjectCollectionValidatorNode(ExternallyConfiguredObjectCollectionValidatorData validatorData)
			: base(validatorData)
		{
		}
		#endregion

		#region Public Methods
		/// <summary>
		/// Creates the validator data.
		/// </summary>
		/// <returns></returns>
		public override Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidatorData CreateValidatorData()
		{
			ExternallyConfiguredObjectCollectionValidatorData validatorData = new ExternallyConfiguredObjectCollectionValidatorData(Name);
			base.SetValidatorBaseProperties(validatorData);

			validatorData.TargetConfigurationFile = TargetConfigurationFile;
			validatorData.TargetRuleSet = TargetRuleSet;

			return validatorData;
		}
		#endregion
	}
}
